#include <iostream>
#include <vector>
using namespace std;

void Test1()
{
	vector<int> v1;

	/*v1.resize(10, 10);
	v1.resize(5, 20);*/

	v1.reserve(15);
	v1.push_back(1);
	v1.push_back(2);
	v1.push_back(3);
	v1.push_back(4);

	for (size_t i = 0; i < v1.size(); ++i)
	{
		cout << v1[i] << " ";
	}
	cout << endl;
	for (size_t i = 0; i < v1.size(); ++i)
	{
		cout << ++v1[i] << " ";
	}
	cout << endl;
	for (auto e : v1)
	{
		cout << e << " ";
	}
	cout << endl;
	
	vector<int>::iterator it = v1.begin();
	while (it != v1.end())
	{
		cout << *it << " ";
		++it;
	}
	cout << endl;
	it = v1.begin();
	while (it != v1.end())
	{
		cout << --(*it) << " ";
		++it;
	}
	cout << endl;

	//cout << v1 << endl;
	//cout << v1.data() << endl;

	int* arr = v1.data();

	vector<int> v2;
	v2.push_back(1);
	v2.push_back(2);
	v2.push_back(3);
	v2.push_back(4);

	vector<int>::const_iterator it1 = v2.cbegin();
	while (it1 != v2.cend())
	{
		//(*it1)++;
		cout << *it1 << " ";
		++it1;
	}
	cout << endl;

	//int a = v1[4];
	//int b = v1.at(4);
	// 
	//v1.shrink_to_fit();

	//v1.pop_back();

	
	/*cout << v1.size() << endl;
	cout << v1.capacity() << endl;
	cout << v1.empty() << endl;*/
}
void Test2()
{
	vector<int> v1(5, 10);
	vector<int> v2;
	v2.resize(5);
	v2.push_back(1);
	v2.push_back(2);
	v2.push_back(3);
	v2.push_back(4);

	vector<int> v3(v2.begin(), v2.end());
	auto v4(v3);
}
void Test3()
{
	vector<int> v1;
	v1.push_back(1);
	v1.push_back(2);
	v1.push_back(3);
	v1.push_back(4);
	v1.push_back(5);

	v1.insert(v1.begin() + 1, 10);
	v1.insert(v1.end() - 1, 2, 20);
	auto v2(v1);
	v2.insert(v2.begin() + 5, v1.begin(), v1.end());

	v2.erase(v2.begin() + 2, v2.end());
	v2.assign(v1.begin(), v1.begin() + 5);
	v2.assign(10, 6);
	v1.swap(v2);
	swap(v1, v2);
}
int main()
{
	//Test1();
	//Test2();
	Test3();

	return 0;
}